﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Customer.Bussiness_Service;
using Entity;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using ServiceCore;

namespace Customer.Areas.System.Controllers
{
    [ApiController, Area("System"), Route("/slot_template/[action]")]
    public class slot_templateController : ControllerBase
    {
        private readonly Islot_template_service _service;
        private readonly IToole_DI _tool;
        public slot_templateController(Islot_template_service service, IToole_DI tool)
        {
            _service = service;
            _tool = tool;
        } 
        /// <summary>
        ///  保存模板消息
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        [HttpPost]
        public ResultObjModel save(slot_template model)
        {
            var result = _service.save_template(model);
            return result;
        }
        /// <summary>
        ///  保存模板消息
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        [HttpPost]
        public ResultListModel pagelist(get_template_list_params query)
        {
            var result = _service.get_template_list(query);
            return result;
        }
        /// <summary>
        ///  保存模板消息
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        [HttpGet]
        public ResultObjModel model(string template_id, int box_no = 0, int box_capacity = 100)
        {
            var result = _service.get_template(template_id, box_no, box_capacity);
            return result;
        } 
        /// <summary>
        /// 删除末班消息
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        [HttpGet]
        public ResultModel del(string template_id)
        {
            var result = _service.del_template(template_id);
            return result;
        }
    }
}